﻿Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Data.SqlClient
Public Class Usuarios

    Private _Nombre As String
    Private _Password As String
    Private _Perfil As String

    Public readerU As New List(Of Usuarios)
    Private reader2 As SqlDataReader



    Sub New()
        Me._Nombre = _Nombre
        Me._Password = _Password
        Me._Perfil = _Perfil
    End Sub




    Public Property Nombre() As String

        Get
            Return Me._Nombre
        End Get
        Set(ByVal value As String)
            Me._Nombre = value
        End Set
    End Property

    Public Property Password() As String

        Get
            Return Me._Password
        End Get
        Set(ByVal value As String)
            Me._Password = value
        End Set
    End Property

    Public Property Perfil() As String

        Get
            Return Me._Perfil
        End Get
        Set(ByVal value As String)
            Me._Perfil = value
        End Set
    End Property

    Public Function Validar(ByVal Usuario As String, ByVal Password As String) As Boolean
        Dim UserDAO As New UsuariosDAO
        UserDAO.Usuario = Usuario
        UserDAO.Password = Password

        reader2 = UserDAO.GetUsuario(Usuario, Password)
        If reader2.HasRows Then
            Return True
        Else
            Return False
        End If

    End Function


    Function Datos()
        Dim DAO As UsuariosDAO = New UsuariosDAO
        readerU = DAO.GetUsuarioporusuario()
        Return readerU
    End Function





End Class
